import unittest

from com.yhzy.testcase.testcase1 import TestCase1
from com.yhzy.testcase.testcase2 import TestCase2
from com.yhzy.testsuit.HTMLTestRunnerX import HTMLTestRunner

if __name__ == '__main__':
    # 测试套件
    testsuit = unittest.TestSuite()
    # 加载测试用例类
    case1 = unittest.TestLoader().loadTestsFromTestCase(TestCase1)
    case2 = unittest.TestLoader().loadTestsFromTestCase(TestCase2)
    # 添加到测试套件
    testsuit.addTests(case1)
    testsuit.addTests(case2)
    # 运行测试套件
    report_file = open('../report/result.html',mode = 'wb')
    runner = HTMLTestRunner(report_file,verbosity=3,title='测试报告',description='my测试报告')
    runner .run(testsuit)